return container;
}
+GskRenderNode *
+cairo_node (guint n)
+{
+ GskRenderNode **nodes = g_newa (GskRenderNode *, n);
+ GskRenderNode *container;
+ cairo_surface_t *surface;
+ graphene_rect_t bounds;
+ gint offset = 0, height, width, stride;
+ guchar *buf;
+ guint i;
+
+ for (i = 0; i < n; i++)
+ {
+ bounds.size.width = g_random_int_range (20, 100);
+ bounds.origin.x = g_random_int_range (0, 1000 - bounds.size.width);
+ bounds.size.height = g_random_int_range (20, 100);
+ bounds.origin.y = g_random_int_range (0, 1000 - bounds.size.height);
+
+ height = g_random_int_range (1, 100);
+ width = g_random_int_range (1, 100);
+ stride = cairo_format_stride_for_width (CAIRO_FORMAT_ARGB32, width + offset);
+
+ buf = g_malloc (stride * height);
+
+ if (i % 3 == 0)
+ surface = NULL;
+ else
+ surface = cairo_image_surface_create_for_data (buf, CAIRO_FORMAT_ARGB32, width, height, stride);
+
+ nodes[i] = gsk_cairo_node_new_for_surface (&bounds, surface);
+
+ /* Offset in stride helps to test when image is not 'tightly packed' condition */
+ offset = offset ? 0 : 3;
+
+ cairo_surface_destroy (surface);
+ g_free (buf);
+ }
+
+ container = gsk_container_node_new (nodes, n);
+
+ for (i = 0; i < n; i++)
+ gsk_render_node_unref (nodes[i]);
+
+ return container;
+}
+
GskRenderNode *
box_shadows (guint n)
{
const char *name;
GskRenderNode * (* func) (guint n);
} functions[] = {
+ { "cairo.node", cairo_node },
{ "colors.node", colors },
{ "clipped-colors.node", clipped_colors },
{ "rounded-borders.node", rounded_borders },